#include "pch.h"

#include "iosystem/stream.h"



namespace IO
{

	///
	RE_ImplementClass('STRM', IO::Stream, Core::ReferenceCount);





	///
	Stream::Stream():
	m_accessMode(ReadAccess),
		m_accessPattern(Sequential),
		m_isOpen(false),
		m_isMapped(false)
	{

	}


	///
	Stream::~Stream()
	{

	}



	///
	void Stream::SetURI(const IO::URI &uri)
	{
		this->m_uri = uri;
	}


	///
	const IO::URI & Stream::GetURI() const
	{
		return this->m_uri;
	}


	///
	bool Stream::CanRead() const
	{
		return false;
	}


	///
	bool Stream::CanWrite() const 
	{
		return false;
	}


	///
	bool Stream::CanSeek() const 
	{
		return false;
	}


	///
	bool Stream::CanMap() const 
	{
		return false;
	}


	///
	void Stream::SetSize(int size)
	{

	}


	///
	int Stream::GetSize() const 
	{
		return 0;
	}


	///
	int Stream::GetPosition() const 
	{
		return 0;
	}


	///
	void Stream::SetAccessMode(AccessMode mode)
	{
		this->m_accessMode = mode;
	}


	///
	void Stream::SetAccessPattern(AccessPattern pattern)
	{
		this->m_accessPattern = pattern;
	}


	///
	void Stream::SetMediaType(const MIME & mime)
	{
		this->m_mime = mime;
	}


	///
	Stream::AccessMode Stream::GetAccessMode() const 
	{
		return this->m_accessMode;
	}


	///
	Stream::AccessPattern Stream::GetAccessPattern() const 
	{
		return this->m_accessPattern;
	}


	///
	const MIME & Stream::GetMediaType() const 
	{
		return this->m_mime;
	}



	///
	bool Stream::Open()
	{
		this->m_isOpen = true;

		return true;
	}


	///
	void Stream::Close()
	{
		this->m_isOpen = false;
	}


	///
	bool Stream::IsOpen() const 
	{
		return this->m_isOpen;
	}


	///
	void Stream::Write(const void * ptr, int bytes)
	{

	}


	///
	int Stream::Read(void *ptr, int bytes)
	{
		return 0;
	}


	///
	void Stream::Seek(int offset, IO::Stream::SeekOrigin origin)
	{

	}


	///
	void Stream::Flush()
	{

	}


	///
	bool Stream::Eof() const
	{
		return true;
	}


	///
	void * Stream::Map()
	{
		this->m_isMapped = true;

		return NULL;
	}


	///
	void Stream::Unmap()
	{
		this->m_isMapped = false;
	}


	///
	bool Stream::IsMapped() const
	{
		return this->m_isMapped;
	}

}